//
//  UIView+zll.m
//  test
//
//  Created by Vincent on 2017/3/31.
//  Copyright © 2017年 Vincent. All rights reserved.
//

#import "UIView+zll.h"

@implementation UIView (zll)

+(id)viewWithTag:(NSInteger)tag onView:(UIView *)pV{
    UIView *tmV = [pV viewWithTag:tag];
    if(tmV==nil){
        tmV = [self.class new];
        tmV.tag = tag;
        [pV addSubview:tmV];
    }
    
    return tmV;
}

-(CGFloat)top{
    
    return self.frame.origin.y;
}

-(CGFloat)left{
    
    return self.frame.origin.x;
}

-(CGFloat)bottom{
    
    return self.frame.origin.y+self.frame.size.height;
}

-(CGFloat)right{
    
    return self.frame.origin.x+self.frame.size.width;
}

-(CGFloat)width{
    
    return self.frame.size.width;
}

-(CGFloat)height{
    
    return self.frame.size.height;
}



@end
